package org.example.qqrobot.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.qqrobot.model.pojo.Collection;
import org.example.qqrobot.model.pojo.Product;

import java.util.List;

@Mapper
public interface CollectMapper {


    @Insert("insert into collection(product_id, user_id) values (#{id},#{currentId})")
    void save(Long id, Long currentId);

    @Select("select product_id from collection where user_id = #{currentId}")
    List<Long> findByUserId(Long currentId);

    @Select("select *from collection where user_id = #{currentId}")
    List<Collection> findAllByUserId(Long currentId);
}
